-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
secret-sharing: Zeroize sensitive data #5928
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for oasisprotocol-oasis-core canceled.
|
d0fabf6
to
cf516e0
Compare
PrimeField implements the Copy trait, which means values are copied when passed as parameters. To prevent sensitive data from being replicated, the switch point struct should accumulate points rather than coordinates.
The AddAssign, SubAssign, and MulAssign functions can now be used only when the prime field supports zeroization. This ensures that any leftover data from heap reallocation, when the right-hand-side polynomial has more coefficients than the left-hand-side, is zeroized. An alternative solution is to remove these functions, but this could lead to performance drawbacks.
cf516e0
to
a3e8637
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5928 +/- ##
=======================================
Coverage 64.62% 64.62%
=======================================
Files 627 627
Lines 64292 64292
=======================================
+ Hits 41546 41550 +4
+ Misses 17823 17820 -3
+ Partials 4923 4922 -1 ☔ View full report in Codecov by Sentry. |
|
||
// Encrypt data using seal_into so that we can zeroize the plaintext. | ||
let mut ciphertext = Vec::with_capacity(plaintext.len() + TAG_SIZE + NONCE_SIZE); | ||
unsafe { ciphertext.set_len(plaintext.len() + TAG_SIZE) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need unsafe here? Couldn't you just use ciphertext.resize
instead?
|
||
// Encrypt data using seal_into so that we can zeroize the plaintext. | ||
let mut ciphertext = Vec::with_capacity(plaintext.len() + TAG_SIZE + NONCE_SIZE); | ||
unsafe { ciphertext.set_len(plaintext.len() + TAG_SIZE) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
No description provided.